# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1ModifyOrgUnitPolicyRequest do
  @moduledoc """
  Request parameters for modifying a policy value for a specific org unit target.

  ## Attributes

  *   `policyTargetKey` (*type:* `GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyTargetKey.t`, *default:* `nil`) - Required. The key of the target for which we want to modify a policy. The target resource must point to an Org Unit.
  *   `policyValue` (*type:* `GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyValue.t`, *default:* `nil`) - The new value for the policy.
  *   `updateMask` (*type:* `String.t`, *default:* `nil`) - Required. Policy fields to update. Only fields in this mask will be updated; other fields in `policy_value` will be ignored (even if they have values). If a field is in this list it must have a value in 'policy_value'.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :policyTargetKey =>
            GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyTargetKey.t() | nil,
          :policyValue =>
            GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyValue.t() | nil,
          :updateMask => String.t() | nil
        }

  field(:policyTargetKey,
    as: GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyTargetKey
  )

  field(:policyValue, as: GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyValue)
  field(:updateMask)
end

defimpl Poison.Decoder,
  for: GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1ModifyOrgUnitPolicyRequest do
  def decode(value, options) do
    GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1ModifyOrgUnitPolicyRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1ModifyOrgUnitPolicyRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
